/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.rie06.openvoip.client.IHM.home;

import com.rie06.openvoip.client.Contact;
import com.rie06.openvoip.client.Conversation;
import com.rie06.openvoip.client.IHM.communication.CommunicationController;
import java.awt.Dimension;
import java.util.UUID;
import javax.swing.*;

/**
 *
 * @author sylvain
 */
public class PanelRequestConversation extends JPanel {

    private CommunicationController communicationController;
    private Contact contact;
    private InterfaceClient interfaceClient;
    private JLabel labelRequestConversation;
    private JLabel labelUuidRequest;
    private JButton buttonAcceptRequest;
    private JButton buttonRefuseRequest;
    private JButton buttonDeleteRequest;
    private UUID uuid;
    private Conversation conversation;

    public PanelRequestConversation(UUID uuid, Contact contact, InterfaceClient interfaceClient, CommunicationController communicationController, Conversation conversation) {

        this.communicationController = communicationController;
        this.interfaceClient = interfaceClient;
        this.conversation = conversation;
        this.uuid = uuid;
        this.contact = contact;


        this.setPreferredSize(new Dimension(190, 50));
       // this.setBackground(Color.red);

        if (conversation.isMaster()) {
            labelUuidRequest = new JLabel("Avec : "+contact.getName());
        } else {
            labelUuidRequest = new JLabel("De : "+contact.getName());
        }

        Icon iconAccept = new ImageIcon("images/accept.png");
        buttonAcceptRequest = new JButton(iconAccept);
        buttonAcceptRequest.addActionListener(communicationController);
        buttonAcceptRequest.setActionCommand("acceptContactToConversation");

        this.add(labelUuidRequest);
        this.add(buttonAcceptRequest);

    }

    public Contact getContact() {
        return contact;
    }

    public UUID getUuid() {
        return uuid;
    }

    public Conversation getConversation() {
        return conversation;
    }
}
